UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FgUn6qdFHgwqImeGmbcuE2g4JHm7Lbk8g+Kc/aqKIhQ=' 
WHERE 
  key_id = '1a1a305c2bdfb9d419f433b8344f24c954105d45fac45a6a0881961341d794cf' 
  AND (
    token = 'FgUn6qdFHgwqImeGmbcuE2g4JHm7Lbk8g+Kc/aqKIhQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041