UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MKit7j7lPZ6g85/YyhfyTEWRaghz9zSBjCYl/jFrukM=' 
WHERE 
  key_id = '68830dc0597f7a52d03415272bc64d48a65621bcc9ada7fc60805ee10e03e3da' 
  AND (
    token = 'MKit7j7lPZ6g85/YyhfyTEWRaghz9zSBjCYl/jFrukM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020