UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sURxMJfB41TTn+3X2DEQMQUHQdt7cCK83RcTZiSiv48=' 
WHERE 
  key_id = '97d86d78fc6d90366e10f19f63641887c95db442f8f5f833c322fb4ebcd83be9' 
  AND (
    token = 'sURxMJfB41TTn+3X2DEQMQUHQdt7cCK83RcTZiSiv48=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028