UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZgAL+GXrLla+iZP7Xrp4nSbGk1eXWvHjYTyKnc/7xY8='
WHERE
key_id = 'f0325d6e8ab4ea90d8d21c15ea30a5a0cece0d2039573d7eec3a531d6f7b42ef'
AND (
token = 'ZgAL+GXrLla+iZP7Xrp4nSbGk1eXWvHjYTyKnc/7xY8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)