UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7Bj+NgrwB5YnEHmQxBGTcyQ7zZpusPiOlTTW17yKHR0=' 
WHERE 
  key_id = 'ccb351ce130058500e34bf1658f7d9370b244626c821607f1c5b7fca2f4cb41a' 
  AND (
    token = '7Bj+NgrwB5YnEHmQxBGTcyQ7zZpusPiOlTTW17yKHR0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053