UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vwxjf4rloId0JJLJWMuCfeZ+tCV0eTF4NnfVC8wnbrk='
WHERE
key_id = '36501564c65ebeb5fa895e31b9986d4600b8c30a3728026e3c3ab2aa736b69d1'
AND (
token = 'vwxjf4rloId0JJLJWMuCfeZ+tCV0eTF4NnfVC8wnbrk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)