UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5hDRXggc3BmmgDvgoIq4V4v7nXoY97658s3YH3a38Ug='
WHERE
key_id = '1f5b940239013c416d34ad7ac8dcff78f32aa23c073c82cbfde12ad14fe431f3'
AND (
token = '5hDRXggc3BmmgDvgoIq4V4v7nXoY97658s3YH3a38Ug='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)