UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'r5n7Fi87JkhtJSmxCgSsNBLaz9U1nOyaAgIVth+orrE=' 
WHERE 
  key_id = '8cabc7fda8c7d0f6e2debf9ab1fd6ce3b998c5e4a5c6bda909fb2c8a921c32be' 
  AND (
    token = 'r5n7Fi87JkhtJSmxCgSsNBLaz9U1nOyaAgIVth+orrE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030