UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sVTq3WjbkTxMQjU9sJCxgC55EDg//Bia5VfQqT9FkF4=' 
WHERE 
  key_id = '93871d5127aa9f9dfb9155bd4526afdb600c99f7a08bd9f35d5045919aa31681' 
  AND (
    token = 'sVTq3WjbkTxMQjU9sJCxgC55EDg//Bia5VfQqT9FkF4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046