UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8ronFZY5Se2zg/yXAceuWgnj3WOscMgt4vYdnJgg8HQ=' 
WHERE 
  key_id = '290516e2cce24b982a36f712551c651fad9a22de203f1aba3332302a417c9878' 
  AND (
    token = '8ronFZY5Se2zg/yXAceuWgnj3WOscMgt4vYdnJgg8HQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020