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