UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FLl7YfgRTrEvOQ6BDFHGlh2FJMQnEYNREynrtz5hnXI=' 
WHERE 
  key_id = 'aa7a86b123d6ab85203b1258866536baeedbc10517af7aee0f9e1f5c5c5a393b' 
  AND (
    token = 'FLl7YfgRTrEvOQ6BDFHGlh2FJMQnEYNREynrtz5hnXI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030