UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6+l6z5iQszeY4wFo/LCoxysSrbsLwrPJnXRX3JG5oVc='
WHERE
key_id = '02371f5cae45ff07499be9e970270e7d9542f8239ef51031613eb240098ebb45'
AND (
token = '6+l6z5iQszeY4wFo/LCoxysSrbsLwrPJnXRX3JG5oVc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)