UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1hgSQ/S90VHlRPzNuZ+Ypl3G8pdwK4IfLMizncm0FPY='
WHERE
key_id = 'd2b4bf8e5a8cf067de9b2606f2ff59dccefc6881eefe45e674dc974e12b2d72f'
AND (
token = '1hgSQ/S90VHlRPzNuZ+Ypl3G8pdwK4IfLMizncm0FPY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)