UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v3plqgiIpn6c9/CbJcfQptKxqj0BjzWuYBLGtu9I+hM=' 
WHERE 
  key_id = '35536e5ae98cadcf95708859ce1c78c1ca34f48ae94836299d6ffcc2c8952381' 
  AND (
    token = 'v3plqgiIpn6c9/CbJcfQptKxqj0BjzWuYBLGtu9I+hM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023