UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GwDlMSHxn/N8BV3Nvm3dSqv3IeGcrCfIXPtfERFt70E=' 
WHERE 
  key_id = '7d026f0ae306f2a7d470f5350f4e5d5375668407536b52b2b160c916ada975bb' 
  AND (
    token = 'GwDlMSHxn/N8BV3Nvm3dSqv3IeGcrCfIXPtfERFt70E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022