UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'V5yK0Zj3E/yAPIBJv65bwP5FCq6+Cx8XzGsNK9nHAc8=' 
WHERE 
  key_id = '5ebe5b6093ea6844cdf016be6dc52bf2a9255f352528ffaca212e140de06e18c' 
  AND (
    token = 'V5yK0Zj3E/yAPIBJv65bwP5FCq6+Cx8XzGsNK9nHAc8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00062