UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GWkuTHsxNdRSOYF/WPwVbdz5xUElIc/08eM+Thmn8xk='
WHERE
key_id = 'fd73964082efc3971df013afca55601023dc99e1198d7dfe9185f18e0fef6c11'
AND (
token = 'GWkuTHsxNdRSOYF/WPwVbdz5xUElIc/08eM+Thmn8xk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)