UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uZPF5G3MocqdpQKQ0cJj0h/z7ycDG5zfkzxKLr3tHXs='
WHERE
key_id = 'acf6dd4b15f8deef458cf70b8a3e7544ce25c121b9d16a11531934ca9768a2a7'
AND (
token = 'uZPF5G3MocqdpQKQ0cJj0h/z7ycDG5zfkzxKLr3tHXs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)