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

Query time 0.00022