UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oSWB+PrAPg1/6T3XAVujqW1vIGgtLhgSUKKS/MioXCY='
WHERE
key_id = '1b94492e7bcabbb0679e470f05fec10f78426aff100a6341aa2d53824fc58769'
AND (
token = 'oSWB+PrAPg1/6T3XAVujqW1vIGgtLhgSUKKS/MioXCY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)