UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RvsrYHlLcCGppedKk2W1Hve8y/wJnq1WIg3L4S0FyE0='
WHERE
key_id = 'd500db717235378c7f31521d792fbf01df15dd6c50b0a3f2129e14d2b85acd04'
AND (
token = 'RvsrYHlLcCGppedKk2W1Hve8y/wJnq1WIg3L4S0FyE0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)