UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '51B+bqs1HzK9/jjIyomDfQg7ZxuiYSr0N+6ZbFgvnPk=' 
WHERE 
  key_id = '37f1bb2c3c0de856611dca950338c6b0e7924a537645b46a25523fb04371293f' 
  AND (
    token = '51B+bqs1HzK9/jjIyomDfQg7ZxuiYSr0N+6ZbFgvnPk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022