UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bp4yWsIpllywpPUX5wgBRVNCPRCMecEZDbuCWaSidOs='
WHERE
key_id = '4b772c511114945967431a110ba16b0a97fe5337194f0c0105c093ff4b3afb64'
AND (
token = 'bp4yWsIpllywpPUX5wgBRVNCPRCMecEZDbuCWaSidOs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)