UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Z6GmpEKFll1ZZH8N/OssTyUdFxeEF8BiRtgIueOFc3U=' 
WHERE 
  key_id = '81f8c6ee6e6710ab1e5d3d4984ebbd362d6a53db9f4af108e37ae9a22e4790d6' 
  AND (
    token = 'Z6GmpEKFll1ZZH8N/OssTyUdFxeEF8BiRtgIueOFc3U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026