UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WuA5OYoXYlV7DUS9uKCtGDV2drTPtgOoBA4PmPJL5JQ='
WHERE
key_id = '08139a718e0a20558b267b401a5fa14ebaf94f98aad39ae5124a3aa56fdb8c26'
AND (
token = 'WuA5OYoXYlV7DUS9uKCtGDV2drTPtgOoBA4PmPJL5JQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)