UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PaDYUmu9LG/UaVpcW0qTZokCOSFamGyy4g+WB2Ch07Y=' 
WHERE 
  key_id = 'a0ad672f0d7511940aa41ab4b298b5a1f071a0f5d2c1e56bd4ee5c3383043a78' 
  AND (
    token = 'PaDYUmu9LG/UaVpcW0qTZokCOSFamGyy4g+WB2Ch07Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00094