UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qj9jEvCUotggA/6eYax3/e3AP1IBrwmCLpCVdW952mk='
WHERE
key_id = '28b2a5653345510288027efc236b946b66ac46537806a4215771acb80b6bc0fc'
AND (
token = 'qj9jEvCUotggA/6eYax3/e3AP1IBrwmCLpCVdW952mk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)