UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HQHHQOLgPgHsjQpGm33kKyLwSRsR6BtRk30lXb87Vk4='
WHERE
key_id = '727867b54698f91a4c10ab73b7b54bd416bce7d4480c019a300f8740fdfffd6d'
AND (
token = 'HQHHQOLgPgHsjQpGm33kKyLwSRsR6BtRk30lXb87Vk4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)