UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TOkEfKruA48peTt3URVq7uwSwU/533dJJfVDKI5RIeQ=' 
WHERE 
  key_id = '0ccc2ab83828d8390fce04630a14c26a858a44550feca28c7304ea75514b1c69' 
  AND (
    token = 'TOkEfKruA48peTt3URVq7uwSwU/533dJJfVDKI5RIeQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029