UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '49W15mOmXNhzkRHFClh3YBRkFt4VugtAYx/qm6YHJQk='
WHERE
key_id = 'ba57a9f749bd84b27962783accc08b72b5d2a3ddeb8bbe0a06411eacb57dd58f'
AND (
token = '49W15mOmXNhzkRHFClh3YBRkFt4VugtAYx/qm6YHJQk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)