UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5pixUqYMiIQKpReOeQkX/Rl3G7Q9Tnp3xPAEd1sUl8A='
WHERE
key_id = '0ad1b02a8275cb8c964d809e23f4352a731a5977314c7f96c8401ee696290dcd'
AND (
token = '5pixUqYMiIQKpReOeQkX/Rl3G7Q9Tnp3xPAEd1sUl8A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)