UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yfKL9gkGYayZcOkMu3p8CnzGmocJJ4ThJZLObEDwkpw=' 
WHERE 
  key_id = '728929fc4d12c57299121c802b7216c4000716a5a0e772130b0d8192a50fb6eb' 
  AND (
    token = 'yfKL9gkGYayZcOkMu3p8CnzGmocJJ4ThJZLObEDwkpw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018