UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MK/Qivfo7WqG3+Ak0gYihwqWCh0sjpKUOeIMk/1bGV0='
WHERE
key_id = '9cf23e19d7f83ba8bfec7b7c0bead289542a9ffd9c43822c2113272b46b7a255'
AND (
token = 'MK/Qivfo7WqG3+Ak0gYihwqWCh0sjpKUOeIMk/1bGV0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)