UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GEBmiuxawdYMgbJY6IEQ6avkO/CCB7ZzClkS6xMs7h8=' 
WHERE 
  key_id = 'e4dade8f74b15efb90bdc2bde3451a2af8c75974b102230c5f0a6c7cd67d6709' 
  AND (
    token = 'GEBmiuxawdYMgbJY6IEQ6avkO/CCB7ZzClkS6xMs7h8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030