UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kuM93V4qpzitvMGJLG4A4T2hGAaYfBagiPDdoqQrLdQ='
WHERE
key_id = 'cb985fe08ab078b245a53d00f9a31e96d1540f6ce90f106c8b78fd68ce8f5fb8'
AND (
token = 'kuM93V4qpzitvMGJLG4A4T2hGAaYfBagiPDdoqQrLdQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)