UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZbWTfDkCjVvyrM8q73oG4Obgae5RjGQVsRwuL3tNDxg='
WHERE
key_id = '9ff8ef53c71de2b8ad103f79dd08eae556b8fef7b468c46b9d5a3052244dcbf0'
AND (
token = 'ZbWTfDkCjVvyrM8q73oG4Obgae5RjGQVsRwuL3tNDxg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)