UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vCpl0+pX+jYkDhWfLlP2p6DCa8QJfd0c6WR7xIsRTFM=' 
WHERE 
  key_id = 'f3d5eddc0c132a3a06bb6020e9a7f22915b27dfdc592b08b2b4cfadcbe6a2047' 
  AND (
    token = 'vCpl0+pX+jYkDhWfLlP2p6DCa8QJfd0c6WR7xIsRTFM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041