UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lSiA9GxaO87dFI1VoDu94Ijou/VebExONu0J+BP7cEU='
WHERE
key_id = 'da1fd19f3d75eefca75f5c342d42e30719da7472fdc1193b193efb620eed5bdd'
AND (
token = 'lSiA9GxaO87dFI1VoDu94Ijou/VebExONu0J+BP7cEU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)