UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ELjgHiElH1qIKLwus+XIYDbmp2geoH6obnJJCqL2tW4='
WHERE
key_id = 'e080add353395d4189b50e9354eb8902510238f7936d8d4306f73384c0cd61c7'
AND (
token = 'ELjgHiElH1qIKLwus+XIYDbmp2geoH6obnJJCqL2tW4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)