UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/WiqyzuZLOQ/82CxU9DtNmMtDFGO1OSUZD5JkNon+5k='
WHERE
key_id = 'd19024b99c2f29c09fc2bf060ec8807e2eff4775fd2614d320f0711d027b6624'
AND (
token = '/WiqyzuZLOQ/82CxU9DtNmMtDFGO1OSUZD5JkNon+5k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)