UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ywBqCq7ji+nOu7qLmw9UekXIrxyltozQ3+eMa0vyeJQ=' 
WHERE 
  key_id = '927cb50d401176719fe5c5990daa0660a4a3b6b9e87cd7912ac4645b7cad8d96' 
  AND (
    token = 'ywBqCq7ji+nOu7qLmw9UekXIrxyltozQ3+eMa0vyeJQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029