UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PLG1WLhb1m0nw+fAxF6mwkeO+NDdkeUIbpQ2t49iRhE=' 
WHERE 
  key_id = '88ccb35e9365e07472de2ebfbe3ae7491bb85901e879c2619a5de27fd52d4973' 
  AND (
    token = 'PLG1WLhb1m0nw+fAxF6mwkeO+NDdkeUIbpQ2t49iRhE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023