UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kSxZdzxoE/MnIXwnp4kCbO1xssa33CWe60n9Z481oE4=' 
WHERE 
  key_id = '3e0aac3f67f735d66f36b367fda08be4c83808beff68da9049eb11447314e293' 
  AND (
    token = 'kSxZdzxoE/MnIXwnp4kCbO1xssa33CWe60n9Z481oE4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023