UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YhsGAv18Eb0x+ziI4hXtlbUqrvDoiSRTV8/IeIMt88g='
WHERE
key_id = '83ed999c45c0d540556fd5d1eaec5e4acbd2ffe22f520ccb384761ae59e0f346'
AND (
token = 'YhsGAv18Eb0x+ziI4hXtlbUqrvDoiSRTV8/IeIMt88g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)