UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qSjSmXr3SyQsZPGE8/DDSOw2qcmxJzFB4ZMH7gMFvas=' 
WHERE 
  key_id = 'fef03ebb33be0e8cb8a6a66a5e0bdc59dae3ff4ed22e5b5f994038dbae67333b' 
  AND (
    token = 'qSjSmXr3SyQsZPGE8/DDSOw2qcmxJzFB4ZMH7gMFvas=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041