UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '17FDPgmZz1IZBQm9EzeGhxujCK1ahZByuU5FGdwoSGw='
WHERE
key_id = '5c1875ec87fee440b0ad70da78952149a3a102aa1a1ba2eb4ca6cb1f203191f8'
AND (
token = '17FDPgmZz1IZBQm9EzeGhxujCK1ahZByuU5FGdwoSGw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)