UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GwOZRBWMFYAti/XaytOqNE9nxsjqxSMABOuDXZVKyTk='
WHERE
key_id = '6262d5723fd6499ba1c7ee7a21ffdf8ed93ef5bd5ca746fa1735b9a28d6f2e12'
AND (
token = 'GwOZRBWMFYAti/XaytOqNE9nxsjqxSMABOuDXZVKyTk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)