UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZlgIPRnnd0uYy+FnZCKsAnpLFajUA28O+cZhybf2X5k=' 
WHERE 
  key_id = '9fc7494bde6da9e2d181720fd0c565d6076b51968392d7ca15f04eb33dcb1b23' 
  AND (
    token = 'ZlgIPRnnd0uYy+FnZCKsAnpLFajUA28O+cZhybf2X5k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044