UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mcwo2MmcqobzXu9YNsmB/bCeI+xEJb/VGkIxRwplwss='
WHERE
key_id = '6f0b48b7ff1baa93ec904135d2b123fd38aa1a80ccb215e4e68cf35afe7c8324'
AND (
token = 'mcwo2MmcqobzXu9YNsmB/bCeI+xEJb/VGkIxRwplwss='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)