UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l7zamYR2Vyjl5goFoj7TmHDfbdu5c5BYDSdmblUugjY='
WHERE
key_id = '2a50dd29550ce33e4e16d3cd66af2aec51462a6bd4c28ef5126307058a81cff8'
AND (
token = 'l7zamYR2Vyjl5goFoj7TmHDfbdu5c5BYDSdmblUugjY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)