UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nHTyfhSY9cHofE0dcXtvdtkgX+53z/MEz3KNBmEakrU='
WHERE
key_id = '35a7c98f9499b28af0440fc0a220bf62a6b7e98682f4bd6080386ebed2c3447d'
AND (
token = 'nHTyfhSY9cHofE0dcXtvdtkgX+53z/MEz3KNBmEakrU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)